package com.xyrl.project.common.csr.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xyrl.common.base.exception.XyrlException;
import com.xyrl.project.common.csr.entity.CsrUser;
import com.xyrl.project.common.csr.vo.CsrUserVo;

/**
 * @author 徐恩源
 * @version 1.0
 * @className CustomerUserService.java
 * @company 重庆星纭融链科技公司
 * @date 2019-12-27 11:25:42
 * @Description 商户service
 */
public interface CsrUserService extends IService<CsrUser> {

    /**
     * 根据登录用户取得用户信息
     *
     * @param userName 登录帐号
     * @author zhongp
     * @date 2019-12-30 13:43:12
     */
    CsrUser findByName(String userName);

    /**
     * 根据手机号查询商户信息
     *
     * @param mobile
     * @author 徐恩源
     * @date 2019-12-30 15:26:29
     */
    public CsrUser getByMobile(String mobile);

    /**
     * 客户登录
     *
     * @param mobile
     * @author zhongp
     * @date 2020-01-02 12:04:44
     */
    CsrUserVo loginByCsr(String mobile) throws XyrlException;

    /**
     * 设置交易密码
     *
     * @param csrId
     * @param pwd
     * @return
     * @throws XyrlException
     */
    void setTradePwd(Long storeId, Long csrId, String pwd) throws XyrlException;

    /**
     * 密码校验
     *
     * @param storeId 商户id
     * @param csrId   客户id
     * @param pwd     密码
     * @throws XyrlException
     */
    void checkTradePwd(Long storeId, Long csrId, String pwd) throws XyrlException;

    /**
     * 身份认证
     *
     * @param storeId
     * @param attIds
     * @return
     * @throws XyrlException
     */
    String personVerify(Long storeId, Long[] attIds) throws XyrlException;

    /**
     * 修改交易密码
     *
     * @param csrId  用户id
     * @param oldPwd 旧密码
     * @param newPwd 新密码
     * @throws XyrlException
     */
    void updateTradePwd(Long storeId, Long csrId, String oldPwd, String newPwd) throws XyrlException;

    /**
     * 找回交易密码
     *
     * @param csrId 用户id
     * @param pwd   交易密码
     * @throws XyrlException
     */
    void findTradePwd(Long storeId, Long csrId, String pwd, String verifyId) throws XyrlException;

}
